/*
 * @Description: 异步导入导出记录表 - 接口
 * @Author:
 * @Date: 2024-07-08 14:27:15
 * @LastEditors:
 * @LastEditTime: 2024-07-08 14:27:15
 */

import { $get, $post, $put } from '@/utils/http'
import { ContentTypeEnum } from '@/constant/http'
import {
  ImportExportModel,
  ImportExportPageParams,
  ImportExportPageResultModel,
  ImportExportResultModel
} from './model/importExportModel'

/**
 * 分页查询
 */
export const apiImportExportSearch = (searchParams: ImportExportPageParams) =>
  $get<ImportExportPageResultModel>({
    url: '/system/importExport/search',
    params: searchParams
  })

/**
 * 根据ID获取详情
 */
export const apiImportExportGetById = (id: string) =>
  $get<ImportExportResultModel>({
    url: '/system/importExport/getById',
    params: { id: id }
  })

/**
 * 保存信息
 */
export const apiImportExportSave = (saveParams: ImportExportModel) =>
  $post<ImportExportResultModel>({
    url: '/system/importExport/save',
    contentType: ContentTypeEnum.json,
    params: saveParams
  })

/**
 * 更新信息
 */
export const apiImportExportUpdateById = (updateParams: ImportExportModel) =>
  $put<ImportExportResultModel>({
    url: '/system/importExport/updateById',
    contentType: ContentTypeEnum.json,
    params: updateParams
  })

/**
 * 批量删除信息
 */
export const apiImportExportBatchDeleteByIds = (ids: string) =>
  $post<ImportExportResultModel>({
    url: '/system/importExport/batchDeleteByIds',
    params: { ids: ids }
  })

/**
 * 批量逻辑删除
 */
export const apiImportExportLogicBatchDeleteByIds = (ids: string) =>
  $post<ImportExportResultModel>({
    url: '/system/importExport/logicBatchDeleteByIds',
    params: { ids: ids }
  })
